// by Xeno
#define THIS_FILE "x_recruitsetup.sqf"
#include "x_setup.sqf"

private ["_D_AI_HUT","_script","_marker_name"];
_D_AI_HUT = __XJIPGetVar(GVAR(AI_HUT));
player reveal _D_AI_HUT;

_marker_name = "d_RecruitB_100000000";
[_marker_name, getPosASL _D_AI_HUT,"ICON","ColorYellow",[0.5,0.5],(localize "STR_DOM_MISSIONSTRING_313"),0,"mil_dot"] call FUNC(CreateMarkerLocal);

_D_AI_HUT addAction [(localize "STR_DOM_MISSIONSTRING_314") call FUNC(BlueText), {_this call FUNC(recruitaiaction)}];

if (!isNil QGVAR(additional_recruit_buildings)) then {
	{
		if (!isNil "_x" && {!isNull _x}) then {
			_marker_name = "d_RecruitB_" + str(_forEachIndex);
			[_marker_name, getPosASL _x,"ICON","ColorYellow",[0.5,0.5],(localize "STR_DOM_MISSIONSTRING_313"),0,"mil_dot"] call FUNC(CreateMarkerLocal);

			_x addAction [(localize "STR_DOM_MISSIONSTRING_314") call FUNC(BlueText), {_this call FUNC(recruitaiaction)}];
		};
	} forEach GVAR(additional_recruit_buildings);
};

GVAR(current_ai_num) = 0;
GVAR(current_ai_units) = [];

if (isNil QGVAR(UnitsToRecruit)) then {
	GVAR(UnitsToRecruit) =
	switch (GVAR(player_side)) do {
		case blufor: {
			["B_Soldier_F", "B_soldier_AR_F", "B_soldier_exp_F", "B_Soldier_GL_F", "B_soldier_M_F", "B_medic_F", "B_soldier_repair_F", "B_soldier_LAT_F"]
		};
		case opfor: {
			["O_Soldier_F", "O_soldier_AR_F", "O_soldier_exp_F", "O_Soldier_GL_F", "O_soldier_M_F", "O_medic_F", "O_soldier_repair_F", "O_soldier_LAT_F"]
		};
	};
};

__pSetVar [QGVAR(recdbusy), false];
